package top.huxy.boot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import top.huxy.boot.util.obj.Env;

/**
 * @author HuXY
 */
@SpringBootApplication
public class BlogApiApplication {
    public static ConfigurableApplicationContext app;
    private static long serverStartDate;
    private static Env env;

    public static void main(String[] args) {
        BlogApiApplication.app = SpringApplication.run(BlogApiApplication.class, args);
        serverStartDate = System.currentTimeMillis();
        env = Env.valueOf(app.getEnvironment().getProperty("spring.profiles.active"));
    }

    public static long getServerStartDate() {
        return serverStartDate;
    }

    public static Env getEnv() {
        return env;
    }
}
